var a = getApp();

Page({
    data: {
        type: "",
        lawyerId: ""
    },
    onLoad: function(a) {
        var e = a.type;
        this.setData({
            type: e
        }), "office" == e ? wx.setNavigationBarTitle({
            title: "律所管理"
        }) : wx.setNavigationBarTitle({
            title: "律师管理"
        }), this.getData();
    },
    link: function() {
        "office" == this.data.type ? wx.navigateTo({
            url: "/packageI/lawyerPlatform/share/share?order_type=office"
        }) : wx.navigateTo({
            url: "/packageI/lawyerPlatform/share/share?order_type=lawyer"
        });
    },
    mseeage: function() {
        "office" == this.data.type ? wx.navigateTo({
            url: "/packageI/lawyerPlatform/message/message?lf_id=" + this.data.lawyerId
        }) : wx.navigateTo({
            url: "/packageI/lawyerPlatform/chat/chat?message_type=2&l_id=" + this.data.lawyerId
        });
    },
    order: function() {
        "office" == this.data.type ? wx.navigateTo({
            url: "/packageI/lawyerPlatform/order/order?order_type=office"
        }) : wx.navigateTo({
            url: "/packageI/lawyerPlatform/order/order?order_type=lawyer"
        });
    },
    lawyerServe: function() {
        wx.navigateTo({
            url: "/packageI/lawyerPlatform/lawyerManage/lawyerManage?id=".concat(this.data.lawyerId)
        });
    },
    lawyerManage: function() {
        wx.navigateTo({
            url: "/packageI/lawyerPlatform/officeManage/officeManage?lawyerId=".concat(this.data.lawyerId)
        });
    },
    getData: function() {
        var e = this;
        "office" == this.data.type ? a._getNetWork({
            url: a.getNetAddresss("plugin.lawyer-platform.frontend.controllers.lawyer-firm.index"),
            success: function(a) {
                1 == a.data.result && e.setData({
                    name: a.data.data.lawyer_firm.name,
                    lawyerId: a.data.data.lawyer_firm.id,
                    logo: a.data.data.lawyer_firm.logo_image
                });
            }
        }) : a._getNetWork({
            url: a.getNetAddresss("plugin.lawyer-platform.frontend.controllers.lawyer.index"),
            success: function(a) {
                1 == a.data.result && e.setData({
                    name: a.data.data.lawyer.name,
                    lawyerId: a.data.data.lawyer.id,
                    logo: a.data.data.lawyer.avatar_image
                });
            }
        });
    },
    handle: function() {
        wx.navigateTo({
            url: "/packageI/lawyerPlatform/info/info?type=" + this.data.type + "detail"
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});